import {Obj} from "@/pages/wordPage/src/interface/Obj";
import screen from "@/pages/wordPage/src/screen";

export default class message extends Obj{
    zIndex=10;
    name="消息提示"
    maxLife=Date.now()+3000;
    message=""
    width=400;
    height=50;
    constructor(message) {
        super();
        this.message=message;
    }
    draw(p) {
        super.draw(p);
        p.rectMode(p.CENTER);
        p.fill("rgb(37,214,253)")
        p.stroke("rgba(1,1,1)")
        p.strokeWeight(5);
        p.rect(screen.width/2,screen.height/2,this.width,this.height,5);
        p.fill("rgba(1,1,1,1)")
        p.textAlign(p.CENTER,p.CENTER);
        p.text(this.message,screen.width/2,screen.height/2,this.width,this.height)
    }

}